#pragma once

#include "Libs/Native/ConnectionLibrary/ConnectionLibrary.h"

using namespace AlgoTrading::ConnectionLibrary;

class ClientConnectionAcceptorImpl : public ClientConnectionAcceptor
{
public:
	virtual ClientRequestProcessorPtr OnClientConnected(std::tr1::weak_ptr<ClientNotificationProcessor> client);
	virtual void OnError(const boost::system::error_code& error);
	virtual void OnDisconnect();
	virtual ~ClientConnectionAcceptorImpl();
};

class ClientHandler : public ClientHandlerBase, public std::tr1::enable_shared_from_this<ClientHandler>
{
public:
	ClientHandler(void);
	virtual ~ClientHandler(void);
	
	virtual void OnRequest(const AlgoTrading::Messages::RequestWithResponse& request);
	virtual void OnRequest(const AlgoTrading::Messages::RequestWithoutResponse& request);

	virtual std::tr1::shared_ptr<ClientRequestProcessor> GetGlientRequestProcessor();
};

typedef std::tr1::shared_ptr<ClientHandler> ClientHandlerPtr;
